package com.salton123.soulove.sailfish.video.ui.adapter

import androidx.recyclerview.widget.DiffUtil
import com.salton123.soulove.sailfish.db.VideoItem

/**
 * Time:2021/9/14 3:55 下午
 * Author:
 * Description:
 */
class VideoDifferCallback : DiffUtil.ItemCallback<VideoItem>() {
    override fun areItemsTheSame(oldItem: VideoItem, newItem: VideoItem): Boolean {
        return oldItem.filePath == newItem.filePath
    }

    override fun areContentsTheSame(oldItem: VideoItem, newItem: VideoItem): Boolean {
        return oldItem.filePath == newItem.filePath &&
            oldItem.updatedAt == newItem.updatedAt &&
            oldItem.playPosition == newItem.playPosition
    }
}